import instance from "@/utils/request";

// 定义接口请求
//查询UserInfoList
export const UserInfoList = (() => {
    return instance({
        method:'GET',
        url:'/listAll' //http://localhost:1529/list
    })
}) 
//根据Id查询单个用户
export const getUserById = ((id:any) =>{
    return instance({
        method:'GET',
        url:'getOneById',
        params:{
            id
        }
    })
})

//删除用户
export const deleteUser = ((id:any) =>{
    return instance({
        method:'DELETE',
        url:'/deleteUser',
        params:{
            id
        }
    })
})

//添加用户 
export const addUser = ((data:any) =>{
    return instance({
        method:'POST',
        url:'/saveUser',
        data:data
    })
})
